package live.jialing.sip.message.box.rest;

import live.jialing.core.web.controller.SimpleBaseRestController;
import live.jialing.sip.message.box.domain.Information;
import live.jialing.sip.message.box.domain.OutBox;
import live.jialing.sip.message.box.domain.OutBoxEmployee;
import live.jialing.sip.message.box.dto.MessageDTO;
import live.jialing.sip.message.box.service.OutBoxEmployeeService;
import live.jialing.sip.message.box.util.ReceiverUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * 发送信息
 */
@RestController
@RequestMapping(value = "/message/send/")
@Slf4j
public class OutBoxRestController  {

    /*@Resource
    private OutBoxEmployeeService outBoxEmployeeService;

    @Override
    public OutBoxEmployeeService getService() {
        return this.outBoxEmployeeService;
    }

    @RequestMapping(value = "/employee", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public void send1(@Valid MessageDTO message) {

        // TODO 公司内部信息

        Information information = new Information();
        information.setContent(message.getContent());
        information.setTitle(message.getTitle());

        OutBoxEmployee outBoxEmployee = new OutBoxEmployee();
        outBoxEmployee.setInformation(information);
        outBoxEmployee.setSender(message.getSender());
        outBoxEmployee.setReceiver(ReceiverUtil.serialization(message.getReceiver()));

    }

    @RequestMapping(value = "/student", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public void send2(MessageDTO message) {

        // TODO 家校通信息
    }*/
}
